package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PassCardOperationLogMapper;
import com.ruoyi.system.domain.PassCardOperationLog;
import com.ruoyi.system.service.IPassCardOperationLogService;

/**
 * 商品次卡操作记录 Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-22
 */
@Service
public class PassCardOperationLogServiceImpl implements IPassCardOperationLogService
{
    @Autowired
    private PassCardOperationLogMapper passCardOperationLogMapper;

    /**
     * 通过id查询商品次卡操作记录
     *
     * @param id 商品次卡操作记录主键
     * @return 商品次卡操作记录
     */
    @Override
    public PassCardOperationLog selectPassCardOperationLogById(Long id)
    {
        return passCardOperationLogMapper.selectPassCardOperationLogById(id);
    }

    /**
     * 通过操作类型，商品次卡编码，操作开始时间，操作结束时间查询商品次卡操作记录列表
     *
     * @param operationType,passCardCode,operationStartTime,operationEndTime 操作类型，商品次卡编码，操作开始时间，操作结束时间
     * @return 商品次卡操作记录
     */
    @Override
    public List<PassCardOperationLog> selectPassCardOperationLogListByConditions(String operationType, String passCardCode, Date operationStartTime, Date operationEndTime)
    {
        return passCardOperationLogMapper.selectPassCardOperationLogListByConditions(operationType,passCardCode,operationStartTime,operationEndTime);
    }

    /**
     * 新增商品次卡操作记录
     *
     * @param passCardOperationLog 商品次卡操作记录
     * @return 结果
     */
    @Override
    public int insertPassCardOperationLog(PassCardOperationLog passCardOperationLog)
    {
        passCardOperationLog.setCreateTime(DateUtils.getNowDate());
        return passCardOperationLogMapper.insertPassCardOperationLog(passCardOperationLog);
    }

    /**
     * 修改商品次卡操作记录
     *
     * @param passCardOperationLog 商品次卡操作记录
     * @return 结果
     */
    @Override
    public int updatePassCardOperationLog(PassCardOperationLog passCardOperationLog)
    {
        return passCardOperationLogMapper.updatePassCardOperationLog(passCardOperationLog);
    }

    /**
     * 通过id批量删除商品次卡操作记录信息
     *
     * @param ids 需要删除的商品次卡操作记录主键
     * @return 结果
     */
    @Override
    public int deletePassCardOperationLogByIds(Long[] ids)
    {
        return passCardOperationLogMapper.deletePassCardOperationLogByIds(ids);
    }

    /**
     * 通过id删除商品次卡操作记录信息
     *
     * @param id 商品次卡操作记录主键
     * @return 结果
     */
    @Override
    public int deletePassCardOperationLogById(Long id)
    {
        return passCardOperationLogMapper.deletePassCardOperationLogById(id);
    }
}
